package leetcode;

import java.util.Arrays;
import java.util.HashMap;

/**
 * 描述:
 *
 * @author Madison You
 * @created 21:46
 */
public class Easy_169_MajorityElement {

    public static void main(String[] args) {
        int[] a = {2,2,1,1,1,2,2,3,4,5,3,3,4,3,3,3,3};
        System.out.println(new Easy_169_MajorityElement().majorityElement(a));
    }


    public int majorityElement(int[] nums) {
        Arrays.sort(nums);
        return nums[nums.length / 2];
    }
}
